package com.xiaoming.e3mall.service.test;

public class ActiveMqSpring {

//    /**
//     * 测试发送消息
//     */
//    @Test
//    public void testSendMessage() throws Exception {
//        //初始化Spring容器
//        ApplicationContext applicationContext = new
//                    ClassPathXmlApplicationContext("classpath:spring/applicationContext-activemq.xml");
//        //从容器中获得JmsTemplate对象
//        JmsTemplate jmsTemplate = applicationContext.getBean(JmsTemplate.class);
//        //从容器中活去Destination对象
//        Destination queueDestination = (Destination) applicationContext.getBean("queueDestination");
//        //发送消息
//        jmsTemplate.send(queueDestination, new MessageCreator() {
//            @Override
//            public Message createMessage(Session session) throws JMSException {
//                return session.createTextMessage("send activemq by spring");
//            }
//        });
//    }



}
